package top.zuli.package03.exam01;

public class StaticProxyDemo3 {
    public static void main(String[] args) {
        User3 user3 = new UserImpl3();
        user3.add("米热");
        user3.del("1");
        User3 proxyUser = new UserProxy3(user3);
        proxyUser.add("李四");
        proxyUser.del("2");
    }
}
interface User3{
    public void add(String data);
    public void del(String id);
}
class UserImpl3 implements User3{

    @Override
    public void add(String data) {
        System.out.println("添加"+data+"据");
    }

    @Override
    public void del(String id) {
        System.out.println("根据"+id+"删除数据");
    }
}
class UserProxy3 implements User3{
    private User3 user3;

    public UserProxy3(User3 user3){
        this.user3 = user3;
    }

    @Override
    public void add(String data) {
        user3.add(data);
        System.out.println("日志信息");
    }

    @Override
    public void del(String id) {
        user3.del(id);
        System.out.println("日志信息");
    }
}
